﻿using Mbs.Messaging;
using NUnit.Framework;

namespace MBTest
{
    [TestFixture]
    public class TopicTest
    {
        [Test]
        public void Test()
        {
            using (var MB = new MessageBus())
            {
                var unsubscriber = MB.Subscribe<int, int, int>(
                    "int", (s, e) => Assert.AreEqual(e.Name, "int")
                    , "int2", (s, e) => Assert.AreEqual(e.Name, "int2")
                    , "int3", (s, e) => Assert.AreEqual(e.Name, "int3"));

                MB.Publish<int>("int2", 2);
                MB.Publish<int>("int1", 1);
                MB.Publish<int>("int3", 3);
                MB.Publish<int>("int", 4);

                unsubscriber.Dispose();
            }

        }
    }
}
